doctype html
html(lang="en" ng-app="3drepo")
	head
		base(href="/")

		// Meta, title, CSS, favicons, etc.
		meta(charset='utf-8')
		meta(http-equiv='X-UA-Compatible', content='IE=edge')

		title 3D Repo | Online BIM collaboration platform

		script(type="text/javascript", src="/public/plugins/base/config.js")

		// ReCapthca
		//script(src="//www.google.com/recaptcha/api.js?render=explicit&onload=vcRecaptchaApiLoaded", async, defer)

		// CSS Files
		each val, key in cssfiles
			link(rel='stylesheet', type='text/css', href=val)

		// All CSS minified
		link(rel='stylesheet', type='text/css', href='/public/dist/three_d_repo.min.css')

		// Styling used in the Angular Material demos
		link(rel="stylesheet", href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,400italic")

		// JS Files
		each val, key in jsfiles
			script(type="text/javascript", src=val)

		if gaTrackId
			script.
				(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
				(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
				m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
				})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

				




		// Predefine the app
		script.
			angular.module('3drepo', ['ui.router', 'ngMaterial', 'ngAnimate', 'ngSanitize', 'vcRecaptcha'])
			.constant('structure', !{structure})
			.constant('parentStates', !{parentStateJSON})
			//.constant('pluginLevels', !{pluginLevelsJSON})
			.constant('uiState', !{uistate});

		// Plugin JS and Angular files
		//script(type="text/javascript", src='/public/dist/plugins.min.js')
		script(type="text/javascript", src='/public/dist/three_d_repo.js')

		// Plugin JS Files
		//each val in pluginJS
			script(type="text/javascript", src=val)

		// Plugin Angular Files
		//each plugin in pluginAngular
			each file in plugin.files
				script(type="text/javascript", src=file)

		// Plugin CSS Files
		//each css in pluginCSS
			link(href=css, rel='stylesheet', type="text/css")

	body

		style.
			#notSupported {
				position: fixed;
				background-color: lightgoldenrodyellow;
				padding: 100px 50px;
				left: 0;
				right: 0;
				margin: auto;
				width: 50%;
				text-align: center;
				z-index: 10;
				top: 20%;
				font-size: 20px;
				height: 70px;
			}

		#notSupported(style='visibility:hidden')
			| Your browser is not supported.
			| Please upgrade to the latest version of 
			a(href='https://www.google.co.uk/chrome', target='_blank') Chrome
			| , 
			a(href='https://www.mozilla.org/firefox', target='_blank') FireFox
			|  or 
			a(target='_blank', href='https://www.microsoft.com/en-gb/windows/microsoft-edge') Edge
			br
			br
			br
			input(id='notSupportedButton' type='button', value='OK', style='padding:10px 60px; font-size:14px;' onclick='document.getElementById("notSupported").style.visibility="hidden"')


		// Plugin JADE Files
		//each j in pluginJade
			script(type="text/ng-template", id=j.id)
				!= renderMe('./plugins/' + j.template, locals)

		// Frontend plugin JADE Files
		each j in frontendJade
			script(type="text/ng-template", id=j.id)
				!= renderMe(j.path, locals)

		// Legal pages
		each j in legalTemplates
			script(type="text/ng-template", id=j.page+".html")
				!= renderMe(j.path, locals)

		home

	|<!-- For IE <= 9-->
	|<!--[if (IE)]>
	|	<script type="text/javascript">
	|		document.getElementById('notSupported').style.visibility='visible';
	|		document.getElementById('notSupportedButton').style.display = 'none';
	|	</script>
	|	
	|<![endif]-->

	script.
		if(BrowserDetect && BrowserDetect.browser === 'Explorer'){
			document.getElementById('notSupported').style.visibility='visible';
			if (BrowserDetect.version <= 10){
				document.getElementById('notSupportedButton').style.display = 'none';
			}
		}

	if googleConversionId

		// Google Code for Remarketing Tag
		//
			------------------------------------------------
			Remarketing tags may not be associated with personally identifiable information or placed on pages related to sensitive categories. See more information and instructions on how to setup the tag on: http://google.com/ads/remarketingsetup
			-------------------------------------------------
		script(type='text/javascript').
			/* <![CDATA[ */
			var google_conversion_id = !{googleConversionId};
			var google_custom_params = window.google_tag_params;
			var google_remarketing_only = true;
			/* ]]> */
		script(type='text/javascript', src='//www.googleadservices.com/pagead/conversion.js')
		noscript
			div(style='display:inline;')
				img(height='1', width='1', style='border-style:none;', alt='', src='//googleads.g.doubleclick.net/pagead/viewthroughconversion/#{googleConversionId}/?guid=ON&script=0')
